const bigIntNum = 9999999999999999999999999999999999n
const bigIntNum2 = BigInt(9999999999999999999999999999999999)

console.log(bigIntNum,bigIntNum2); // 9999999999999999999999999999999999n 9999999999999999455752309870428160n
// 数据过大的时候，使用Bigint构造函数，我们应该用字符串表示

const bigIntNum3 = BigInt("9999999999999999999999999999999999")
console.log(bigIntNum3);

console.log(3n + 2n); // 5n
console.log(3n * 2n); // 6n
console.log(3n - 2n); // 1n
console.log(3n / 2n); // 1n
console.log(3n ** 2n); // 9n

console.log(2n + "hello"); // 2hello
console.log("world" + 3n); // world3


// console.log(2 + 2n); // Cannot mix BigInt and other types, use explicit conversions

// Math.pow(2n) // Cannot convert a BigInt value to a number

console.log(2 == 2n); // true
console.log(2 === 2n); // false


console.log(3n < 4); // true
console.log(4n > 3); // true


console.log(!!0n); // false
console.log(!!1n); // true

console.log(Number(1n)); // 1
console.log(BigInt(1)); // 1n 

// 边界问题
console.log(Number(9999999999999999999999999999999999n)); // 1e+34
console.log(BigInt(1.1)); // The number 1.1 cannot be converted to a BigInt because it is not an integer